using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Input.Touch;
using Microsoft.Xna.Framework.Media;
using Zigzag.GameWorld;
using FarseerPhysics;
using FarseerXNABase.ScreenSystem;
using FarseerXNABase;
using FarseerXNABase.Components;

namespace Zigzag
{
    /// <summary>
    /// This is the main type for your game
    /// </summary>
    public class Zigzag : Microsoft.Xna.Framework.Game
    {
        GraphicsDeviceManager graphics;
        //SpriteBatch spriteBatch;

        //ScreenManager ScreenManager;
        Texture2D button;

        public Zigzag()
        {
            Window.Title = "Zigziag game test";

            graphics = new GraphicsDeviceManager(this);
            graphics.PreferMultiSampling = true;
            graphics.PreferredBackBufferWidth = CAssets.SCREEN_WIDTH;
            graphics.PreferredBackBufferHeight = CAssets.SCREEN_HEIGHT;
            ConvertUnits.SetDisplayUnitToSimUnitRatio(16f);
            graphics.IsFullScreen = true;

            IsFixedTimeStep = false;

            Content.RootDirectory = "Content";

            ScreenManager = new ScreenManager(this);
            Components.Add(ScreenManager);

            FrameRateCounter FrameRateCounter = new FrameRateCounter(ScreenManager);
            FrameRateCounter.DrawOrder = 101;
            Components.Add(FrameRateCounter);


            // Frame rate is 30 fps by default for Windows Phone.
            //TargetElapsedTime = TimeSpan.FromTicks(333333);

            // Extend battery life under lock.
            //InactiveSleepTime = TimeSpan.FromSeconds(1);

        }

        public ScreenManager ScreenManager { get; set; }

        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            // TODO: Add your initialization logic here

            base.Initialize();


        }

        
    }
}
